import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

// 专题页管理
export function getSpecialPageList(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/topic/page',
		method: 'post',
		data
	})
}

export function addSpecialPage(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/topic/add',
		method: 'post',
		data
	})
}

export function editSpecialPage(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/topic/edit',
		method: 'post',
		data
	})
}

export function editSpecialPageContent(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/topic/content/edit',
		method: 'post',
		data
	})
}

export function getSpecialPageContent(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/topic/detail?topicId=' + data,
		method: 'post',
	})
}

// 专题页商品设置
export function getSpecialPageProduct(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/page',
		method: 'post',
		data
	})
}

export function addProductToSpecialPage(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/add',
		method: 'post',
		data
	})
}

export function setSpecialPageProductStatus(params) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/modify',
		method: 'post',
		params
	})
}


//橱窗展示商品管理
export function getDisplayProductList(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/page',
		method: 'post',
		data
	})
}

export function addDisplayProduct(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/product/sku/sale/recommend/showcase/add',
		method: 'post',
		data
	})
}

// 社区排名
export function getCommunityRanking(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/community/commonweal/page',
		method: 'post',
		data
	})
}

export function getCommunityRankingDetail(data) {
	return request({
		url: sysPath + '/hx-mart/api/v1/community/commonweal/detail/page',
		method: 'post',
		data
	})
}

export function getCommunityList(query) {
	return request({
		url: sysPath + '/hx-mart/api/v1/community/page',
		method: 'post',
		query
	})
}